#include<stdio.h>
#include<string.h>
//#include<stdlib.h>
struct Trie{
	#define Trie_maxn 1000 
	#define CharterMax 26
	#define idx(A) (A-'a')
	#define u idx(TpChr)
	
	int ch[Trie_maxn][CharterMax],val[Trie_maxn],cnt=0;
	int TpInd=0;
	char TpChr='\0';
	int cnts = 0;
	
	void init(){
//		memset(ch[0],0,sizeof(ch[0]));
		cnt = 0;
	}
	
	void insert(char* str){
		int len = strlen(str) ;
		int c = ++cnts;
//		printf("In.\n");
		TpInd=0;
		for(int i=0;i<len;i++){
//			printf("location at line 20: i = %d ind = %d cnt=%d\n",i,TpInd,cnt);
			TpChr = str[i];
			if(!ch[TpInd][u]){
//				printf("Insert at %d.\n",i);
				val[TpInd] = 0;
				ch[TpInd][u] = ++cnt;
			}
//			printf("location at line 26: ch[TpInd][u]=%d\n",ch[TpInd][u]);
			TpInd = ch[TpInd][u];
		}
		val[TpInd] = c;
		return;
	}
	
	bool find(const char* str){
		int len = strlen(str) ;
		TpInd=0;
		for(int i=0;i<len;i++){
			TpChr = str[i];
//			printf("In %d is %c ch[TpInd][u] = %d .\n",i,TpChr,ch[TpInd][u]);
			if(!ch[TpInd][u]){
//				printf("out-not-all at %d\n",i);
				return false;
			}
			TpInd = ch[TpInd][u];
		}
		if(!val[TpInd])
			return false;
//		printf("finded.\n");
		return true;
	}
	
	#undef Trie_maxn
	#undef CharterMax
	#undef idx(A)
};
int main(){
	
	return 0;
} 
